home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / std / c / 13 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  1.8 KB

  1. Path: phoenix.rhein.de!yaps!arno
  2. From: arno@yaps.rhein.de (Arno Eigenwillig)
  3. Newsgroups: comp.std.c
  4. Subject: Re: Alignment of malloc()
  5. Message-ID: <WwvTx*SVe@yaps.rhein.de>
  6. Date: Wed, 03 Jan 1996 07:58:50 +0100
  7. References: <DKDA7D.Kw7@midway.uchicago.edu> <j66Sx*FRe@yaps.rhein.de> <DKKHCH.L6r@midway.uchicago.edu>
  8. Organization: Yet Another Private Site in Meckenheim, Germany
  9. X-Copyright: This article may not be distributed on a CD-ROM
  10.  or in printed form without prior written consent of the author.
  11. X-Newsreader: Arn V 1.04
  12.  
  13. In article <DKKHCH.L6r@midway.uchicago.edu>, Michael Spertu writes:
  14.  
  15. > My question is what the committee means by the words "proper alignment".
  16.  
  17. Aligned in a way so that the data can be accessed.
  18.  
  19. > it means that I would have to align all malloc() returns according to
  20. > the size of the data in all portable code I write.
  21.  
  22. Manual alignment is not portable! Better leave such low-level stuff to
  23. the compiler. I was merely commenting on the case where you want to
  24. trick a certain single compiler.
  25.  
  26. > For this reason, the two possibilities are:
  27. > 1) All the texts (including K & R) are advocating code that is not reasonable
  28. > on (the most common) compliant implementations of C.
  29. > or
  30. > 2) 32 bit alignment of malloc() on PCs is not compliant.
  31.  
  32. Wrong. I wish you had read what I and others wrote. ;)
  33.  
  34. Speed *never* is relevant for compliance. By The Standard, strictly
  35. conforming C programs take input and produce output in a finite time,
  36. following the semantics of the abstract machine. Everything else
  37. depends on the quality of the compiler you use, but is beyond The
  38. Standard, and thus, beyond this group. I feel not like saying that a
  39. third time, though.
  40.  
  41. -- __
  42. __/// Arno Eigenwillig /\ <arno@yaps.rhein.de> \/  PGP key
  43. \XX/   V+49-2225-5870  /\ <Arnooo @ #amigager> \/ available
  44.